﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<JLL.China.Web.Areas.Portal.Models.EventModel>" %>
<%@ Import Namespace="System.IO" %>
<!-- start id-form -->
<% using (Html.BeginForm("QuickEvent", "Event", FormMethod.Post, new { id = "formID", enctype = "multipart/form-data", @class = "validateform" }))
   { %>
<% = Html.HiddenFor(x => x.Event.ID) %>
<% = Html.HiddenFor(x => x.Event.Event_ID) %>
<% = Html.HiddenFor(x => x.Event_Local.Event_ID) %>
<% = Html.HiddenFor(l => l.Event.LanguageFID) %>
<% = Html.HiddenFor(l => l.Event_Local.LanguageFID) %>
<table border="0" cellpadding="0" cellspacing="0" class="tbl-form">
    <tr>
        <td>
            <label>
                <span class="mandate">*</span> Title English</label>
            <%= Html.TextBoxFor(m => m.Event.Title, new {  @class = "validate[required] inp-form"})%>
        </td>
        <td>
            <label>
                <span class="mandate">*</span> Title Local</label>
            <%= Html.TextBoxFor(m => m.Event_Local.Title, new {  @class = "validate[required] inp-form"})%>
        </td>
    </tr>
    <tr>
        <td >
            <label>
                <span class="mandate">*</span> Date</label>
                <input type="text" name="Event.EventDate" value="<%=(this.Model.Event !=null)?this.Model.Event.EventDate.ToString("MM/dd/yyyy"):"" %>" style = "width:150px;" class = "validate[required] style_datetime " id = "EventDate"/>
           <%-- <%= Html.TextBoxFor(m => m.Event.EventDate, new { name = "EventDate", id = "EventDate", @class = "validate[required] style_datetime ", style = "width:150px;" })%>--%>
            <!--TIME 1-->
            <%= Html.TextBoxFor(m=>m.Event.EventTime, new { name = "EventTime", id = "EventTime", @class = "validate[required] style_datetime", style = "width:68px;" })%>
            <span>To </span>
              <!--TIME 2-->
            <%= Html.TextBoxFor(m => m.Event.EventTimeEnd, new { name = "EventTimeEnd", id = "EventTimeEnd", @class = "validate[required] style_datetime", style = "width:68px;" })%>
           <%-- <%= Html.TextBoxFor( m => m.Event.EventDateEnd, new { name = "EventDateEnd", id = "EventDateEnd", @class = "validate[required] style_datetime", style = "width:150px;" })%>--%>
             <input type="text" name="Event.EventDateEnd" value="<%=(this.Model.Event !=null)?this.Model.Event.EventDateEnd.ToString("MM/dd/yyyy"):"" %>" style = "width:150px;" class = "validate[required] style_datetime " id = "EventDateEnd"/>
             </td>
         <td >
          
                <span class="mandate">*</span>Email
            <%= Html.TextBoxFor(m => m.Event.ContactEmail, new { name = "event_email", id = "event_email", @class = "validate[required,custom[email]] inp-form", style = "width:188px;" })%>
           
                <span class="mandate">*</span>Status
          
                <%=Html.DropDownListFor(m => m.Event.Status, new List<SelectListItem>
                     {
                        new SelectListItem{Selected = true, Text="Active", Value = "true" }, 
                        new SelectListItem{Selected = false, Text="Inactive", Value = "false" },
                     }, new { id = "event_status", name = "event_status", @class = "chzn-nosearch chz" ,style="width:80px"})%>
                 <span class="mandate">*</span>Event Color  
                 <input class="inp-form" id="color-event" name="" readonly="" style="width:18px;background: <%=(this.Model.Event.EventColor!=null)?(this.Model.Event.EventColor):"#FAD165"%>" type="text" >
                 <input id="color-event-value" name="Event.EventColor" type="hidden" value="<%=(this.Model.Event.EventColor!=null)?(this.Model.Event.EventColor):"#FAD165"%>">
           
        </td>
    </tr>
    <tr>
        <td>
            <label>
                <span class="mandate">*</span> Where(English)</label>
            <%= Html.TextBoxFor(m => m.Event.Where, new { name = "where", id = "where", @class = "validate[required] inp-form"})%>
        </td>
        <td>
            <label>
                <span class="mandate">*</span> Where(Local)</label>
            <%= Html.TextBoxFor(m => m.Event_Local.Where, new { name = "where", id = "where1", @class = "validate[required] inp-form"})%>
        </td>
    </tr>
    <tr>
        <td>
            <label>
                <span class="mandate">*</span> Event Summary(English)</label>
            <input id="summary_validate" class="validate[required]" style="visibility: hidden;
                height: 0; width: 0" />
            <%= Html.TextAreaFor(m => m.Event.EventSummary, new { id = "summary", name = "summary",rows="3"})%>
        </td>
        <td>
            <label>
                <span class="mandate">*</span> Event Summary(Local)</label>
            <input id="summary_local_validate" class="validate[required]" style="visibility: hidden;
                height: 0; width: 0" />
            <%= Html.TextAreaFor(m => m.Event_Local.EventSummary, new { id = "summary_local", name = "summary1", rows = "3" })%>
        </td>
    </tr>
    <tr>
        <td>
            <label>
                <span class="mandate">*</span> Event Detail(English)</label>
            <input id="content_validate" class="validate[required]" style="visibility: hidden;
                height: 0; width: 0" />
            <%= Html.TextAreaFor(m => m.Event.EventContent, new { id = "event_content", name = "event_content", @class = "ckeditors"})%>
        </td>
        <td>
            <label>
                <span class="mandate">*</span> Event Detail(Local)</label>
            <input id="content_local_validate" class="validate[required]" style="visibility: hidden;
                height: 0; width: 0" />
            <%= Html.TextAreaFor(m => m.Event_Local.EventContent, new { id = "content_local", name = "event_content1", @class = "ckeditors" })%>
        </td>
    </tr>
   
    <tr>
        <td colspan="2">
            <label>
                <span class="mandate">*</span>Attachment</label>
            <div style="text-align: left; min-width: 437px;">
                <input type="file" name="files" id="files_0" /><br />
                <br />
                <input type="file" name="files" id="files_1" /><br />
                <br />
                <input type="file" name="files" id="files_2" /><br />
                <br />
            </div>
            <div style="text-align: left; min-width: 437px;">
                <%
                    var files = ViewData["files"] as List<FileInfo>;
                    if (files != null)
                    {%>
                <p>
                    <span style="font: italic"><i>(Right click on the file -> choose Save as... to download
                        file)</i></span></p>
                <br />
                <% 
                    foreach (var file in files)
                    {
                %>
                <a href="<%=file.FullName %>">
                    <%=file.Name %></a>
                <%= Html.ActionLink(" ", "DeleteFile", new { e = Model.Event.Event_ID, l = Model.Event.LanguageFID, filename=file.FullName }, new { @title = "Delete", @class = "icon-2 info-tooltip remove-btn" })%>
                <br />
                <br />
                <%
                    }
                          }
                %>
            </div>
        </td>
    </tr>
    
   
    <tr>
        <td valign="top" colspan="2">
            <input type="submit" value="Submit" onclick="checkForm()" class="buttons" style="margin-right: 8px;
                float: right" />
            <%--<input type="submit" value="" class="form-submit" onclick=" checkFormAndUpload(); " />--%>
            <input type="reset" value="Reset" class="buttons" style="margin-right: 8px; float: right" />
        </td>
        <td>
        </td>
    </tr>
</table>
<%} %><!-- end id-form  -->